// 查看全部待办事项
function myTaskMore(){
	var obj={"text":'我的任务',"url":contextRootPath + '/welcomeDeal/prepareExecute/toQueryPageaAll'};
	parent.showObj(obj);
	}
//在welcome 页面-我的任务模块myTaskTable 处创建表格 统计待办事项
function createTable(objs,totalRows,contentId,c1,c2){
	var tableStr=[''];
	for(var i=0;i<totalRows;i++){
		tableStr.push('<tr style="height:25px;font-size:12px;">');
			tableStr.push('<td>');
				var dealType = objs[i].dealType;
				tableStr.push("&nbsp&nbsp&nbsp&nbsp&nbsp");
				tableStr.push("<a href='javascript:void(0)' onclick='doTask(\""+dealType+"\")' style='color: rgb(17, 102, 228);text-decoration: underline;'>");
				tableStr.push("您有【"+objs[i].accountNum+"】批次");
					if("01" == dealType){
						tableStr.push("【债权转让】");
					}else if("02" == dealType){
						tableStr.push("【债权受让】");
					}else if("09" == dealType){
						tableStr.push("【二次购买】");
					}else if("03" == dealType){
						tableStr.push("【贷款转出】");
					}
					tableStr.push("待办交易");
				tableStr.push('</a>');
			tableStr.push('</td>'); 
		tableStr.push('</tr>');
	}
	$("#"+contentId).html(tableStr.join(""));
}

//点击明细列表“交易类型”
function doTask(dealType){
	var url = contextRootPath + '/welcomeDeal/prepareExecute/toQueryPage?dealType=' +dealType;
	if("01" == dealType){// 债权转让交易
		var obj={"text":'债权转让待办明细',"url":url};
		parent.showObj(obj); 
	}else if("02" == dealType){// 债权受让交易
		var obj={"text":'债权受让待办明细',"url":url};
		parent.showObj(obj); 
	}else if("09" == dealType){// 二次购买
		var obj={"text":'二次购买待办明细',"url":url};
		parent.showObj(obj); 
	}else if("03" == dealType){// 贷款转出交易
		var obj={"text":'贷款转出待办明细',"url":url};
		parent.showObj(obj); 
	}else{
		jyDialog({"type":"error"}).alert("交易类型不正确！");
	}
	
}	
/**
 * myTaskList.jsp修改按钮事件
 */
function toUpdateData(){
	var v_ids = iframe.iframeObj["table"].getSelectedIds().join(",");
	//如果没有选中 数据则
	if(v_ids == ""){
		jyDialog({"type":"info"}).alert("请选择待修改的数据！");
		return;
	}
	//如果选择多个 择提示
	if(v_ids.indexOf(",") > -1){
		jyDialog({"type":"info"}).alert("请选择一条数据！");
		return;
	}
	var dealType = iframe.iframeObj["table"].getSelectedObjs("dealType");
	var cooperorgCode = iframe.iframeObj["table"].getSelectedObjs("cooperorgCode");
	var contractCode = iframe.iframeObj["table"].getSelectedObjs("contractCode");
	var creditPackageName = iframe.iframeObj["table"].getSelectedObjs("creditPackageName");
	var dealCode = iframe.iframeObj["table"].getSelectedObjs("dealCode");
	var cooperativeAgencyDealStatus = iframe.iframeObj["table"].getSelectedObjs("cooperativeAgencyDealStatus");
	/*jyDialog({"type":"error"}).alert("dealType:"+dealType+"~cooperorgCode:"+cooperorgCode+"~contractCode:"+contractCode+"~creditPackageName:"+creditPackageName+"~dealCode:"+dealCode+"~cooperativeAgencyDealStatus:"+cooperativeAgencyDealStatus);*/
	if("01" == dealType){// 债权转让交易修改界面
		var obj={"text":'修改转让交易',"url":contextRootPath+'/tCMmContract/prepareExecute/toBackCooperorgDealUpdate?contractCode=' + contractCode + "&creditPackageName=" + creditPackageName + "&dealCode=" + dealCode + "&cooperativeAgencyDealStatus=" + cooperativeAgencyDealStatus + "&cooperorgCode=" + cooperorgCode + "&idDeal=" + v_ids};
		parent.showObj(obj);
	}else if("02" == dealType){// 债权受让交易修改界面
		var obj={"text":'修改受让交易',"url":contextRootPath+'/creditDealController/prepareExecute/toBackTransfereeDealUpdate?contractCode=' + contractCode + "&dealCode=" + dealCode + "&cooperativeAgencyDealStatus=" + cooperativeAgencyDealStatus + "&cooperorgCode=" + cooperorgCode + "&idDeal=" + v_ids};
		parent.showObj(obj);
	}else if("09" == dealType){// 二次购买修改界面
		var obj={"text":'修改债权购买交易',"url":contextRootPath+'/creditBuy/prepareExecute/toUpdate?contractCode=' + contractCode + "&creditPackageName=" + creditPackageName + "&cooperorgCode=" + cooperorgCode + "&dealCode=" + dealCode +"&id=" +v_ids};
		parent.showObj(obj);
	}else if("03" == dealType){// 贷款转出交易修改界面
		var obj={"text":'修改贷款交易',"url":contextRootPath+'/tCMmContract/prepareExecute/toBackLoanDetailUpdate?contractCode=' + contractCode + "&cooperorgCode=" + cooperorgCode + "&creditPackageName=" + creditPackageName + "&dealCode=" + dealCode + "&cooperativeAgencyDealStatus=" + cooperativeAgencyDealStatus+ "&idDeal=" + v_ids};
		parent.showObj(obj);
	}else{
		jyDialog({"type":"error"}).alert("交易类型不正确！");
	}
}
 